package vip.xiaozhao.paotui.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import vip.xiaozhao.paotui.intf.entity.PaotuiDetailAudit;
import vip.xiaozhao.paotui.intf.enums.PaotuiGoingStatusEnum;
import vip.xiaozhao.paotui.intf.mapper.PaoTuiDetailAuditMapper;
import vip.xiaozhao.paotui.intf.service.PaotuiAuditService;

import javax.annotation.Resource;

@Service
@Slf4j
public class PaotuiAuditServiceImpl implements PaotuiAuditService {
    @Resource
    private PaoTuiDetailAuditMapper auditMapper;

    @Override
    public int insert(PaotuiDetailAudit audit) {
        return auditMapper.insert(audit);
    }

    @Override
    public PaotuiDetailAudit loadById(int id) {
        return null;
    }

    @Override
    public PaotuiDetailAudit loadByUserIdAndGoingStatus(int userId,int paotuiId,  PaotuiGoingStatusEnum statusEnum) {
        return auditMapper.loadByUserIdAndGoingStatus(userId, paotuiId, statusEnum.getId());
    }

    @Override
    public PaotuiDetailAudit loadLatestByUserIdAndPaotuiId(int userId, int paotuiId) {
        return auditMapper.loadLatestByUserIdAndPaotuiId(userId, paotuiId);
    }


}
